GOOGLE_CLASSPATH = :lib/gdata-calendar-2.0.jar:lib/gdata-core-1.0.jar:lib/gdata-client-1.0.jar:lib/guava-10.0.1.jar
SQL_CLASSPATH = :lib/sqlitejdbc-v056.jar


all: Meal MealTest GUI Docs

Print: 
	echo $(HEADER)
Tests: MealTest 

MealTest: Meal
	javac tests/MealTest.java

MealTestCase1: tests/MealTestCase1.java
	javac tests/MealTestCase1.java

Meal: meal/Meal.java Ingredient Direction Docs
	javac meal/Meal.java

Ingredient: meal/Ingredient.java
	javac meal/Ingredient.java

Direction: meal/Direction.java
	javac meal/Direction.java

CalendarInterface:
	javac -J-Xms32m -J-Xmx96m -classpath ".$(GOOGLE_CLASSPATH)" util/CalendarInterface.java

SysTray:
	javac -J-Xms32m -J-Xmx96m -classpath ".$(GOOGLE_CLASSPATH)" gui/SysTray.java

ScheduleGUI:
	javac -classpath ".$(GOOGLE_CLASSPATH)" gui/scheduler/*.java

IngredientGUI:
	javac -classpath ".$(GOOGLE_CLASSPATH)$(SQL_CLASSPATH)" gui/IngredientGUI.java

Util:
	javac -classpath ".$(GOOGLE_CLASSPATH)$(SQL_CLASSPATH)" util/*.java

GUI: IngredientGUI ScheduleGUI SysTray CalendarInterface

#Temporary solution until we can set CLASSPATH
Run:
	java -classpath ".$(GOOGLE_CLASSPATH)$(SQL_CLASSPATH)" gui/IngredientGUI

Run_CalendarInterface:
	java -XX:PermSize=32M -Xms16m -Xmx96m -classpath ".$(GOOGLE_CLASSPATH)$(SQL_CLASSPATH)" $(patsubst Run_%,%,$@)

Run_SysTray:
	java -XX:PermSize=32M -Xms16m -Xmx96m -classpath ".$(GOOGLE_CLASSPATH)$(SQL_CLASSPATH)" gui/SysTray 

Set_Classpath:
	export CLASSPATH=$$CLASSPATH:.$(GOOGLE_CLASSPATH)$(SQLCLASSPATH)

Docs: 
	rm -rf docs/*
	javadoc -d docs/ -noqualifier java.lang meal/*.java tests/*.java util/*.java

clean:
	rm -f gui/*.class util/*.class meal/*.class gui/scheduler/*.class scheduler/*.class
